/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Home-pc
 * Date: 2024-03-09
 * Time: 8:59
 */
public class Sort {
    public static void bubbleSort(int[] arrary){
        for(int i = 0;i< arrary.length-1;++i){
            for(int j = 0;j < arrary.length-1-i;++j){
                if(arrary[j] >arrary[j+1]){
                    swap(arrary,j,j+1);
                }
            }
        }
    }

    private static void swap(int[] arrary, int j, int i) {
        int temp = arrary[i];
        arrary[i] = arrary[j];
        arrary[j] = temp;

    }


}
